<template>
	<el-card shadow="never" header="登录日志">
    <el-table v-loading="loading" :data="pageData.data" ke="log" @sort-change="changeTableSort"
              style="width: 100%;font-size: 12px;padding:10px 20px;box-sizing: border-box;">
      <el-table-column label="用户姓名" prop="userName" width="100">
      </el-table-column>
      <el-table-column label="登陆账号" prop="account" width="100">
      </el-table-column>
      <el-table-column label="登录IP" prop="ip" width="130">
      </el-table-column>
      <el-table-column label="客户端" prop="client" width="100">
      </el-table-column>
      <el-table-column label="状态" prop="stateName" width="100">
      </el-table-column>
      <el-table-column label="登录时间" prop="addDate"   >
      </el-table-column>
    </el-table>
    <div class="page">
      <el-pagination background :current-page="searchObject.no" :page-sizes="[10, 20, 50, 100]"
                     :page-size="pageData.size" :pager-count="5"
                     layout="total, sizes, prev, pager, next, jumper" :page-count="pageData.totalPage"
                     :total="pageData.total" @size-change="sizeChange" @current-change="pageChange">
      </el-pagination>
    </div>
	</el-card>
</template>

<script setup>
import {usePage} from "@/utils/usePage";
import {ref} from "vue";

const searchObject=ref({
  no: 1,
  size: 10,
  sortField:"id",
  sortMethod:"desc"
})

const {
  pageData,
  sizeChange,
  pageChange,
  search,
  changeTableSort,
  loading
} = usePage("/userLoginLog/search", searchObject.value);
</script>

<style>
</style>
